package com.ylr.controller;

import com.ylr.common.model.result.R;
import com.ylr.domain.SysUser;
import com.ylr.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Description TODO
 * @Author 11
 * @Date 2021/4/23 20:12
 * @Version 1.0
 */


@RestController
@Api(tags = "后台系统测试接口")
public class TestController {
    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/user/info/{id}")
    @ApiOperation(value = "根据用户id查询用户信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "用户id")
    })
    public R<SysUser> getSysUserInfo(@PathVariable("id")Long id){
        SysUser sysUser = sysUserService.getById(id);
        return R.ok(sysUser);

    }

}
